<template>
	<view>
		<view class="" style="padding: 10px 10px;">
			<view style="margin-top: 8px;">
				<template v-if="focusList&&focusList.data.length">
					<view class="item justify-between"  v-for="(item, index) in focusList.data" :key="index">
						<view style="" @click="nav('/pages/opera/video/play?opera_id='+item.opera_id)">
							<img :src="baseURL+'/'+item.opera_info.logo_img" alt="" style="height: 170px;width: 100px;border-radius: 10px;">
						</view>
						<view style="margin-left: 10px;flex-grow: 1;" class="justify-between flex-col">
							<view style="margin-top: 40px;font-weight: 700;" @click="nav('/pages/opera/video/play?opera_id='+item.opera_id)">{{ item.opera_info.name }}</view>
							<view class="align-end justify-between" style="width: 100%;">
								<view style="font-size: 12px;flex-shrink: 0;">更新至 第{{ item.collection_count }}集</view>
								<view @click="delCollect(item.opera_focus_id)" class="border-color text-color" style="padding: 10px 30px;border-radius: 10px;text-align: center;">停止追剧</view>
							</view>
						</view>
					</view>
				</template>
				<Empty v-else></Empty>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				baseURL:this.baseURL,
				focusList: null
			}
		},
		onLoad() {
			this.getData()
		},
		methods: {
			getData(){
				this.get('OperaFocus/index').then(({code,paginate})=>{
					if(code==1){
						this.focusList = paginate;
					}
				});
			},
			delCollect (opera_focus_id) {
				this.post('crud/delete', {table: 'opera_focus', table_id: opera_focus_id}).then(({code,paginate})=>{
					if(code==1){
						this.success('删除成功')
						this.getData()
					}
				})
			}
		}
	}
</script>

<style lang="scss">
.empty_class{
	.tag_1{
		margin-top: 0 !important;
	}
	.tag_2{
		font-size: 60px !important;
	}
	.tag_3{
		font-size: 12px !important;
	}
}
</style>
